
package com.shop.cereshop.business.controller.versions;

import com.shop.cereshop.business.service.versions.AppVersionsService;
import com.shop.cereshop.commons.constant.CoReturnFormat;
import com.shop.cereshop.commons.domain.versions.AppVersions;
import com.shop.cereshop.commons.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * <p>
 * 前端控制器
 * 多端应用版本管理表
 * </p>
 *
 * @author
 * @date 2025-08-02
 */
@Slf4j
@RestController
@RequestMapping("/appVersions")
@Api(value = "AppVersions", tags = "多端应用版本管理表")
public class AppVersionsController {
    @Autowired
    private AppVersionsService appVersionsService;
    @GetMapping("/getAppVersion")
    @ApiOperation(value = "查询多端应用版本(已用)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "appName", value = "应用名称: user-用户端，merchant-商家端 ", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "platform", value = "平台类型：ios，android ", required = true, dataType = "String", paramType = "query"),
    })
    public Result<AppVersions> getAppVersion(String appName, String platform) {
        return new Result(appVersionsService.getAppVersionContent(appName, platform), CoReturnFormat.SUCCESS);
    }

}
